﻿<!DOCTYPE HTML>
<html>
<head>
<meta charset="utf-8">
<meta name="renderer" content="webkit|ie-comp|ie-stand">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
<meta http-equiv="Cache-Control" content="no-siteapp" />
<!--  <link rel="Bookmark" href="#(ctx_path)/common/favicon.ico" >
  <link rel="Shortcut Icon" href="#(ctx_path)/common/favicon.ico" />-->
<!--[if lt IE 9]>
<script type="text/javascript" src="#(ctx_path)/lib/html5shiv.js"></script>
<script type="text/javascript" src="#(ctx_path)/lib/respond.min.js"></script>
<![endif]-->
<link href="#(ctx_path)/static/h-ui/css/H-ui.min.css" rel="stylesheet" type="text/css" />
<link href="#(ctx_path)/static/h-ui.admin/css/H-ui.login.css" rel="stylesheet" type="text/css" />
<link href="#(ctx_path)/static/h-ui.admin/css/style.css" rel="stylesheet" type="text/css" />
<link href="#(ctx_path)/lib/Hui-iconfont/1.0.8/iconfont.css" rel="stylesheet" type="text/css" />
<!--[if IE 6]>
<script type="text/javascript" src="#(ctx_path)/lib/DD_belatedPNG_0.0.8a-min.js" ></script>
<script>DD_belatedPNG.fix('*');</script>
<![endif]-->
<title>贷超后台</title>
<meta name="keywords" content="">
<meta name="description" content="">
</head>
<body>
<div class="header"></div>
<div class="loginWraper">
  <div id="loginform" class="loginBox">
    <form class="form form-horizontal" action="#(ctx_path)/login_/login" method="post">
      <div class="row cl">
        <label class="form-label col-xs-3"><i class="Hui-iconfont">&#xe60d;</i></label>
        <div class="formControls col-xs-8">
          <input id="username" name="username" type="text" placeholder="账户" class="input-text size-L">
        </div>
      </div>
      <div class="row cl">
        <label class="form-label col-xs-3"><i class="Hui-iconfont">&#xe60e;</i></label>
        <div class="formControls col-xs-8">
          <input id="password" name="password" type="password" placeholder="密码" class="input-text size-L">
        </div>
      </div>
      <div class="row cl">
        <div class="formControls col-xs-8 col-xs-offset-3">
          <input class="input-text size-L" id="captcha" name="captcha" type="text" placeholder="验证码" style="width:150px;">
          <img id="verifCode" alt="验证码出错啦~!" src="#(ctx_path)/login_/img" /> <a id="kanbuq" href="javascript:reload_verifCode()">看不清，换一张</a> </div>
      </div>
      <!--<div class="row cl">
        <div class="formControls col-xs-8 col-xs-offset-3">
          <label for="online">
            <input type="checkbox" name="online" id="online" value="">
            使我保持登录状态</label>
        </div>
      </div>-->
      <div class="row cl">
        <div class="formControls col-xs-8 col-xs-offset-3">
          <input name="" type="button" onclick="javascript:loginSubmit();" class="btn btn-success radius size-L" value="&nbsp;登&nbsp;&nbsp;&nbsp;&nbsp;录&nbsp;">
          <input name="" type="reset" class="btn btn-default radius size-L" value="&nbsp;取&nbsp;&nbsp;&nbsp;&nbsp;消&nbsp;">
        </div>
      </div>
    </form>
  </div>
</div>
<div class="footer">Copyright #(application.getAttribute("itemTodayConfig").companyname) by JsonFs</div>
<script type="text/javascript" src="#(ctx_path)/lib/jquery/1.9.1/jquery.min.js"></script>
<script type="text/javascript" src="#(ctx_path)/static/h-ui/js/H-ui.min.js"></script>
<script type="text/javascript" src="#(ctx_path)/lib/layer/2.4/layer.js"></script>

<script>
  $("body").keydown(function () {
      if (event.keyCode == '13'){//keyCode=13是回车键
          loginSubmit();
      }
  });

  function loginSubmit() {
      //获取参数
      var username = $("input#username").val();
      var password = $("input#password").val();
      var captcha = $("input#captcha").val();
      if(username == ''){
          layer.tips('用户名不能为空','#username',{
              tips:[2,'#FFA8BB']
          })
          $("input#username").focus();
          return;
      }
      if(password == ''){
          layer.tips('密码不能为空','#password',{
              tips:[2,'#FFA8BB']
          })
          $("input#password").focus();
          return;
      }
      if(captcha == ''){
          layer.tips('验证码不能为空','#captcha',{
              tips:[2,'#FFA8BB']
          })
          $("input#captcha").focus();
          return;
      }
      var strJson = {"username":username,"password":password,"captcha":captcha};
      jQuery.ajax({
          url:'#(ctx_path)/login_/login.html',
          type:"post",
          data:strJson,
          success:function (data) {
              if (data.isSuccess == true){
                  location.href = "#(ctx_path)/admin/home.html";
              } else{
                  layer.alert(data.result, {
                      skin: 'layui-layer-lan',
                      closeBtn: 0
                  });
              }
          },
          error:function(data) {
              layer.msg('系统错误，请联系管理员！', {icon: 5,time:1500});
              console.log(data.msg);
          }
      })
  }

  function reload_verifCode(){
      $("#verifCode").attr("src","#(ctx_path)/login_/img?" + Math.random());
  }
</script>
</body>
</html>